<?php
    require_once('phplib/markdown.php');
    require_once('phplib/smartypants.php');    
    
    class ContentCourierProcessorMarkdown extends ContentCourierProcessorFactory{
        public function processContent($string){
            return Markdown($string);
        }
    }    
    class ContentCourierProcessorSmarty extends ContentCourierProcessorFactory{
        public function processContent($string){
            return SmartyPants($string);
        }
    }     
    
    class ContentCourierLoaderFileSystem extends ContentCourierLoaderFactory{
        /**
        * Base file path to use for the content store
        * @todo this belongs elsewhere
        * @var string $basePath
        */             
        public $basePath;

        public function __construct(){
        }

        /**
        * Simple setter
        * @param string $path
        */                 
        public function setBasePath($path){
            $this->basePath = $path;
        }        
        
        /**
        * Loads the content
        *
        * Override this to decide where your content is coming from.
        * database, web service call, etc.
        * @param string $uri
        * @return string
        */                 
        public function loadContent($uri){
            ob_start();
            //return $this->basePath.$URI;
            include($this->basePath.$uri);
            return ob_get_clean();
        }
        
        /**
        * Applies additional formatting to pageURIs passedthrough as content URIs
        *
        * When using a passthrough, have a chance to manupulate the URI before it's
        * assigned as the contentURI.  Use this if you want ot use the passthrough
        * feature, but have some system dependant thing going on like a php file extension
        * @param string $uri
        * @return string
        */                 
        public function applyPassthroughFilter($uri){
            return $uri.'.php';
        }        
    }    
    //
?>